package com.smiautumn.monolithic.common.exception;

import cn.hutool.core.util.StrUtil;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class SystemException extends RuntimeException {

    private Integer code;

    private String msg;

    public SystemException() {
        super("服务器异常");
        this.code = -1;
        this.msg = "服务器异常";
    }

    public SystemException(String msg, Object... arguments) {
        super(StrUtil.format(msg, arguments));
        this.code = -1;
        this.msg = StrUtil.format(msg, arguments);
    }

    public SystemException(Integer code, String msg, Object... arguments) {
        super(StrUtil.format(msg, arguments));
        this.code = code;
        this.msg = StrUtil.format(msg, arguments);
    }
}
